package com.deyang.mycommon.adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.deyang.mycommon.R;
import com.deyang.mycommon.entity.BaseAdapterTestItem;

import java.util.List;

/**
 * @author wangdyang
 * @createDate 2018年7月14日13:45:17
 * @desc 测试使用 BaseRecyclerViewAdapterHelper
 */

public class TestBaseAdapter extends BaseQuickAdapter<BaseAdapterTestItem, BaseViewHolder> {

    private Context context;

    public TestBaseAdapter(Context context, @Nullable List<BaseAdapterTestItem> data) {
        super(R.layout.item_test_base_adapter, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, BaseAdapterTestItem item) {
        helper.setBackgroundColor(R.id.iv_del, item.getRes());
        helper.setText(R.id.tv_desc, item.getDesc());

        helper.addOnClickListener(R.id.iv_del);
    }
}
